package com.wyl.studyredis.business.service;

import com.wyl.studyredis.business.entity.Student;
import com.wyl.studyredis.business.vo.StudentVo;

public interface IStudentCacheService {

    /**
     * 根据id在缓存中查询，如果缓存不存在则尝试在数据库中查询，如果查询不为空则将查询结果设置到缓存中
     * @param id 主键
     * @param isDeep 是否会继续获取对象类型的属性
     */
    StudentVo getStudentVoByIdInCache(String id, boolean isDeep) throws Exception;

    Student saveAndCache(Student student) throws Exception;

    Student updateByIdAndCache(Student student) throws Exception;

    void removeByIdAndCache(String id);
}
